<template>
	<div class="h-full flex flex-col">
		<div class="flex-1 overflow-y-auto px-3 py-2">
			<el-form ref="form" v-model="form" label-position="top" label-width="80px" size="small">
			  <el-form-item label="meter_code">
			    <!--<el-input v-model="formproty.metercode" @input="update"></el-input>-->
          <div class="el-input">
            <input type="text" @input="update" v-model="formproty.metercode" class="el-input__inner"/>
          </div>
          <!--<el-input-number v-model="formproty.metercode" @change="update" :precision="0"></el-input-number>-->
			  </el-form-item>
				<el-form-item label="X">
				  <el-input-number v-model="formproty.x" @change="update" :precision="0"></el-input-number>
				</el-form-item>
				<el-form-item label="Y">
				  <el-input-number v-model="formproty.y" @change="update" :precision="0"></el-input-number>
				</el-form-item>
				<el-form-item label="宽度">
				  <el-input-number v-model="formproty.width" :min="1" @change="update" :precision="0"></el-input-number>
				</el-form-item>
				<el-form-item label="高度">
				  <el-input-number v-model="formproty.height" :min="1" @change="update" :precision="0"></el-input-number>
				</el-form-item>
        <!--<el-form-item label="颜色">-->
          <!--<div>-->
            <!--<el-input-->
              <!--size="small"-->
              <!--v-model="form.fillStyle"-->
              <!--controls-position="right"-->
              <!--@change="update"-->
            <!--&gt;  <el-color-picker v-model="form.fillStyle" slot="prepend"  size="mini"  @change="form"></el-color-picker></el-input>-->

          <!--</div>-->
        <!--</el-form-item>-->
				<!--<el-form-item label="文本">-->
				  <!--<el-input v-model="form.text"></el-input>-->
				<!--</el-form-item>-->
			</el-form>
		</div>
		<!--<div class="mt-3 p-3 border-t">-->
			<!--<el-button type="primary" class="w-full" @click="update()">更新</el-button>-->
		<!--</div>-->
	</div>
</template>

<script>
	export default {
		data() {
			return {
				form: {},
        formproty: {}
			}
		},
		methods: {
			setProperty(property) {
     //   this.form = property
//        this.formproty = property
        this.formproty.id = property.id
        this.formproty.metercode = property.metercode
        this.formproty.x = property.x
        this.formproty.y = property.y
        this.formproty.width = property.width
        this.formproty.height = property.height
      },
			update() {
          this.form.id = this.formproty.id
          this.form.metercode = this.formproty.metercode
          this.form.x = this.formproty.x
          this.form.y = this.formproty.y
          this.form.width = this.formproty.width
          this.form.height = this.formproty.height
          console.log('change', this.form)
          this.$emit('change', this.form)
			},
		},

	}
</script>

<style>
</style>
